<script>
export default {
  name: "Student",
  data(){
    return{name:'张三',age:29}
  },
  methods:{
    sendName() {
      this.$emit('studentEvent',this.name);
    }
  }
}
</script>

<template>
  <div>
    <h1>学生姓名:{{name}}</h1>
    <h1>学生年龄:{{age}}</h1>
    <button @click="sendName">发送学生姓名到app</button>
  </div>
</template>

<style scoped>

</style>
